package com.geekc.threadpool.constant;

import java.util.concurrent.TimeUnit;

/**
 * 线程池常量信息
 * @author Carnegie Lee
 */
public class ThreadPoolConst {
    /** 默认核心线程数（计算密集型） */
    public static final int DEFAULT_CORE_POOL_SIZE_COMPUTE = Runtime.getRuntime().availableProcessors() + 1;
    /** 默认核心线程数（IO密集型） */
    public static final int DEFAULT_CORE_POOL_SIZE_STREAM = Runtime.getRuntime().availableProcessors() * 2;
    /** 默认最大线程数 */
    public static final int DEFAULT_MAXIMUM_POOL_SIZE = 16;
    /** 默认空闲线程存活时间 */
    public static final int DEFAULT_KEEPALIVE_TIME = 3600000;
    /** 默认空闲线程存活单位 */
    public static final TimeUnit DEFAULT_TIME_UNIT = TimeUnit.MILLISECONDS;
    /** 默认阻塞队列大小 */
    public static final int DEFAULT_BLOCKING_QUEUE_SIZE = 8;
    /** 默认线程名称前缀 */
    public static final String DEFAULT_PREFIX_THREAD_NAME = "worker-thread-";
}
